import MessageItem from "./components/MessageItem";
import {useSelector} from "react-redux";

const RealTimeMessage = () => {
    let state = useSelector(state => state)
    let messages = state.systemTips

    return (
        <div className="absolute top-0 left-0 p-3 z-5 max-h-30rem overflow-hidden">
            {
                messages.map((message, index) =>
                    <MessageItem key={index} message={message}/>
                )
            }
        </div>
    )
}

export default RealTimeMessage